const express = require('express');
const http = require('http');

const app = express();

app.all('*', (req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*');
  res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE');
  next();
});

http.createServer(app).listen(3000, () => {
  console.log('服务器启动在3000端口');
});
